package com.hmdp.common.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author WDs , wds8.24@outlook.com
 * @version 1.0
 * @since 2023-01-22 18:45
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClientBeanFactory(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
        return Redisson.create(config);
    }
}
